package com.tencreat.mall.controller.app;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tencreat.common.annotation.Log;
import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.controller.BaseController;
import com.tencreat.common.core.domain.AjaxResult;
import com.tencreat.common.enums.BusinessType;
import com.tencreat.common.utils.poi.ExcelUtil;
import com.tencreat.domain.account.RechargeLimitChange;
import com.tencreat.service.mall.IRechargeLimitChangeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * app代采购额度记录Controller
 *
 * @author tencreat
 * @company 深圳腾创互联科技有限公司
 * @link https://tencreat.com
 * @since 2023-11-15
 */
@Api(tags = "app代采购额度记录api")
@RestController
@RequestMapping("/appRechargeLimitChange")
@RequiredArgsConstructor
public class RechargeLimitChangeController extends BaseController {

    private final IRechargeLimitChangeService rechargeLimitConfigService;

    @ApiOperation(value = "查询代采购额度记录列表")
    @PostMapping("/list")
    HttpResult<IPage<RechargeLimitChange>> list(@RequestBody RechargeLimitChange rechargeLimitChange) {
        IPage<RechargeLimitChange> page = new Page<>(rechargeLimitChange.getPageNum(), rechargeLimitChange.getPageSize());
        rechargeLimitChange.setUuid(getUuid());
        return HttpResult.ok(rechargeLimitConfigService.page(page, rechargeLimitChange));
    }
}